package com.hopster;

import android.app.TabActivity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

/**
 * Entry point to our Android app.
 */
public class HopsterActivity extends TabActivity
{
	
	public static Context context;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        context = this;
        
        Resources res = getResources(); // Resource object to get Drawables
        TabHost tabHost = getTabHost();  // The activity TabHost
        TabHost.TabSpec spec;  // Resusable TabSpec for each tab
        Intent intent;  // Reusable Intent for each tab

        // Create an Intent to launch an Activity for the tab (to be reused)
        intent = new Intent().setClass(this, CalendarPage.class);
        
        // Initialize a TabSpec for each tab and add it to the TabHost
        spec = tabHost.newTabSpec("calendar").setIndicator("Calendar",
                          res.getDrawable(R.drawable.ic_tab_calendar))
                      .setContent(intent);
        tabHost.addTab(spec);
        
        // Do the same for the other tabs
        intent = new Intent().setClass(this, AlarmPage.class);
        spec = tabHost.newTabSpec("alarmPage").setIndicator("Alarms",
                          res.getDrawable(R.drawable.ic_tab_alarms))
                      .setContent(intent);
        tabHost.addTab(spec);
        
        /*intent = new Intent().setClass(this, LogicalMath.class);
        spec = tabHost.newTabSpec("testerActivity").setIndicator("Puzzle",
        				res.getDrawable(R.drawable.ic_jigsaw))
        			.setContent(intent);
        tabHost.addTab(spec);*/
    }
}